package com.jeeplus.modules.sys.entity;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 * @title: Pagination
 * @projectName JeePlus
 * @description: TODO
 * @date 2019/11/1216:39
 */

public class Pagination {
    /// <summary>
    /// 每页行数
    /// </summary>
    private int rows;

    public void setRows(int rows) {
        this.rows = rows;
    }

    public int getRows() {
        return this.rows;
    }

    /// <summary>
    /// 当前页
    /// </summary>
    private int page;

    public void setPage(int page) {
        this.page = page;
    }

    public int getPage() {
        return this.page;
    }

    /// <summary>
    /// 排序列
    /// </summary>
    private String sidx;

    public void setSidx(String sidx) {
        this.sidx = sidx;
    }

    public String getSidx() {
        return this.sidx;
    }

    /// <summary>
    /// 排序类型
    /// </summary>
    private String sord;

    public void setSord(String sord) {
        this.sord = sord;
    }

    public String getSord() {
        return this.sord;
    }

    /// <summary>
    /// 总记录数
    /// </summary>
    private int records;

    public void setRecords(int records) {
        this.records = records;
    }

    public int getRecords() {
        return this.records;
    }

    public int total() {
        if (records > 0) {
            return records % this.rows == 0 ? records / this.rows : records / this.rows + 1;
        } else {
            return 0;
        }
    }
    private List<Map<String,Object>> data=new ArrayList<>();
    public void setData(List<Map<String,Object>> data){
        this.data=data;
    }
    public List<Map<String,Object>> getData(){
        return this.data;
    }
}
